import Vue from 'vue'
import VueRouter from 'vue-router'
import RenderRouterView from '@/components/RenderRouterView'

Vue.use(VueRouter)

const routes = [

  {
    path: "/",
    redirect:"/user/login"
  },

  {
    path: "/user",
    component:RenderRouterView,
    children:[
      {
        path:'/user/login',
        name:'login',
        component: () => import(/* webpackChunkName: "user" */ '../views/user/Login.vue')
      },
      {
        path:'/user/register',
        name:'register',
        component: () => import(/* webpackChunkName: "user" */ '../views/user/Register')
      }
    ]
  },
  {
    path: '/ok',
    name: 'Ok',
    component: () => import(/* webpackChunkName: "about" */ '../views/state/OK.vue')
  },

  {
    path: '/home',
    name: 'home',
    component: () => import(/* webpackChunkName: "about" */ '../views/Home.vue')
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
